home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Softshoe / Lisa's Mac Parts / Activation / Enableable.h < prev    next >
Text File  |  2000-06-23  |  566b  |  38 lines

  1. // Enableable.h
  2.  
  3. #ifndef Enableable_h
  4. #define Enableable_h
  5.  
  6. #ifndef Integers_h
  7. #include "Integers.h"
  8. #endif
  9. #ifndef Assert_h
  10. #include "Assert.h"
  11. #endif
  12.  
  13. class Enableable
  14.   {
  15.     private:
  16.         bool enabled;
  17.  
  18.     protected:
  19.         virtual void BeEnabled()                {}
  20.         virtual void BeDisabled()                {}
  21.  
  22.         ~Enableable()                                {}
  23.                     
  24.     public:
  25.         Enableable( bool startEnabled )
  26.           : enabled( startEnabled )
  27.           {
  28.             Assert( startEnabled == !!startEnabled );
  29.           }
  30.  
  31.         bool Enabled() const            { return enabled; }
  32.         void Enable();
  33.         void Disable();
  34.         void SetEnabled( bool b );
  35.   };
  36.  
  37. #endif
  38.